import '../public/index'
import store from 'store'

let data = new Vue({
  el: '#data',
  data: () => ({
    channel       : '',
    cradNo        : '',
    message       : '',
    sendMsg       : '',
    inMsg         : '',
    excuteStatus  : '',
    tagName       : '',
    realName      : '',
    idCardNo      : '',
  }),
  mounted: function() {
    let storeData = store.get('storeData')

    if (!storeData) {
      layer.msg('页面跳转错误', {
        icon: 5
      })

      setTimeout(() => {
        window.location = './index.html'
      }, 1000)

      return
    }

    // 合并数据
    $.extend(this.$data, storeData)

    switch (this.$data.channel){
      case 'xingye':
        this.$data.channel = '兴业'
      break;
      case 'zheshang':
        this.$data.channel = '浙商'
        break;
      default:
        this.$data.channel = this.$data.channel
    }
  }
})

